package com.xinxing.learning.batch.console;

import com.xinxing.learning.batch.common.LogConstants;
import com.xinxing.learning.batch.service.ConsoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
public class ConvertProcessor implements ItemProcessor<String, String> {
    @Autowired
    private ConsoleService consoleService;

    @Override
    public String process(String data) throws Exception {
        String dataProcessed = consoleService.convert2UpperCase(data);
        log.info(LogConstants.LOG_TAG + data + " process data --> " + dataProcessed);
        return dataProcessed;
    }
}
